package com.kedou.sdk.params;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;
import com.kedou.sdk.params.bean.ActivityInfo;

import java.util.List;

/**
 * Created by Administrator on 2017/6/7 0007.
 */

public class ActivityResponseParams extends ResponseParams<ActivityResponseParams.ActivityResponseData> {


    public static class ActivityResponseData implements Parcelable {

        @SerializedName("list")
        private List<ActivityInfo> activityInfos;

        public List<ActivityInfo> getActivityInfos() {
            return activityInfos;
        }

        public void setActivityInfos(List<ActivityInfo> activityInfos) {
            this.activityInfos = activityInfos;
        }

        public boolean isEmpty(){
            return activityInfos == null || activityInfos.isEmpty();
        }

        public ActivityResponseData() {
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeTypedList(this.activityInfos);
        }

        protected ActivityResponseData(Parcel in) {
            this.activityInfos = in.createTypedArrayList(ActivityInfo.CREATOR);
        }

        public static final Creator<ActivityResponseData> CREATOR = new Creator<ActivityResponseData>() {
            @Override
            public ActivityResponseData createFromParcel(Parcel source) {
                return new ActivityResponseData(source);
            }

            @Override
            public ActivityResponseData[] newArray(int size) {
                return new ActivityResponseData[size];
            }
        };
    }


}
